<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <meta name="format-detection" content="address=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="browsermode" content="application" />
    <meta name="x5-page-mode" content="app" />
    <title>悟空钱包</title>
    <meta charset="utf-8" />
    <link href="./css/main.css?rev=@@hash" rel="stylesheet" />
    <style>
        body{
            width: 3.75rem;
            position: relative;
            /*background-color: white;*/
        }
        .cells {
		    position: static;
		    top: 0;
		    left: 0;
		    transform: translate(0,0);
		    margin: .2rem auto;
		    background: #094CD3;
	        box-shadow: 0px 0px 6px 0px rgb(9, 76, 211);
        }
        .cells_title {
            text-align: center;
            width: 2rem;
            margin: 0 auto;
            padding: .12rem .2rem;
            font-size: .16rem;
            height: .22rem;
            color: rgb(68,74,89);
        }
        .cells_title a {
            display: block;
            float: left;
            font-size: .12rem;
            height: .2rem;
            line-height: .2rem;
            padding-left: .05rem;
            color: red;
        }
        .cells_title span {
            display: block;
            float: left;
            font-size: .13rem;
            height: .22rem;
            line-height: .22rem;
            margin-left: .2rem;
            color: rgb(136,136,136)
        }
        .cell_hd {
            font-size: .12rem;
            text-align: left;
            color: rgba(255, 255, 255, 0.8);
        }
        .cardBanner {
		    width: 100%;
		    background: #5699FF;
		    overflow: hidden;
        }
        .cardBannerAfter{
		    width: 100%;
		    background: #5699ff;
		    border-radius: 0 0 100% 100%;
		    margin-top: -1px;
		    border-bottom: .3rem solid #5699ff;   	
        }
        .cardBanner img {
            position: absolute;
            width: 100%;
            z-index: 1;
        }
        .cardBannerWrap{
            float: left;
            color: #fff;
            margin-top: .23rem;
        }
        .cardBanner .titleLeft {
            width: 1.6rem;
            margin: .04rem 0 0 .15rem;
            text-align: left;
            font-family: PingFang-SC-Regular;
            /* font-weight: 700; */
            font-size: .12rem;
            color: rgba(255, 255, 255, 0.8);
        }
        .cardBanner .titleRight {
            width: 1rem;
            /* font-weight: 700; */
            font-size: .16rem;
            margin: .04rem 0 0 .25rem;
            font-size: .12rem;
            color: rgba(255, 255, 255, 0.8);
        }
        .cardBanner>span {
            display: block;
            height: .3rem;
            float: left;
            padding: 0;
            font-size: .3rem;
            color: white;
        }
        .cardBanner .titleContentLeft {
            margin: .25rem 0 0 .15rem;
            height: .4rem;
        }        
        .cardBanner .titleContentRight {
            height: .4rem;
            margin: .25rem 0 0 .4rem;
        }
        .cardBanner .titleContentLeft>sup{
            font-size: .15rem;
        }
        .samllText{
            display: inline-block;
            padding: 0 .06rem 0 0;
            font-size: .3rem;
            font-weight: 600;
        }
        .clear{
        	clear: both;
        }
        .cell_cn {
		    text-align: left;
		    font-size: .15rem;
		    font-weight: bold;
        }
        .cell .cell_cn1{
            font-size: .14rem;
        }
        .cell .cell_cn2,
        .cell .cell_cn3{
            font-size: .15rem;
        }
        .cell_hd a {
            display: inline-block;
            color: rgb(229,192,149);
            font-size: .12rem;
        }

        .operatorContent {
            width: 100%;
            margin-top: .37rem;
            background: #f9f9f9;
        }
        .txt {
            text-align: left;
        }
        .confirmBtn {
            position: static;
            display: block;
            width: 3.43rem;
            height: .45rem;
            font-family: PingFang-SC-Medium;
            font-size: .15rem;
            margin: 0 auto;
            border-radius: .42rem;
            background-color: #3276fe;
        }
        .getCode {
            color: red;
            font-size: .12rem;
        }
        .cell_ft img {
            display: block;;
            width: .2rem;
            height: .1rem;
        }
        .tip {
            line-height: .2rem;
            height: .2rem;
            overflow: hidden;
            margin: 0 .2rem .2rem;
        }
        .tip span{
            display: block;
            float: left;
            font-size: .12rem;
            line-height: .2rem;
            height: .2rem;
        }
        .tip i {
            display: block;
            width: .12rem;
            height: .12rem;
            margin: 0.01rem .04rem 0.02rem 0rem;
            float: left;
        }
        .tip i img {
            width: 100%;
        }

        /*进度条*/
        ul.lanren{
            margin: .4rem auto;
            height: 1rem;
        }
        .scale_panel{
            color:#999;
            position:absolute;
            line-height: .18rem;
            top:.2rem;
        }
        .scale>span{
            background-color: #2AD2C8;
            width:30px;
            height:30px;
            position:absolute;
            left:-2px;top:-10px;
            cursor:pointer;
            border-radius: 50%;
            font-size: .2rem;
        }
        .scale{
            background-color: #eee;
            border-left: .01rem #83BBD9 solid; 
            width: 2rem;
            height: .1rem; 
            position: relative; 
            border-radius: .15rem; 
        }
        .scale>div{ 
            background-repeat: repeat-x; 
            background-color: rgb(253,152,91); /*进度条颜色*/
            width: 0px; 
            position: absolute; 
            height: .1rem; 
            width: 0; left: 0; bottom: 0; 
            border-radius: .2rem;
        }
        .lanren>li{
            margin-left: 3.50px;
            position:relative;
            list-style:none;
            font-size: 30px;
        }
        #title{
            position: absolute;
            top: 40px;
            left: 30px;
        }
        

        .layer_dialog_box .layer_dialog_ft {
            margin: .2rem auto;
        }
        .layer_dialog_box .layer_btn {
            border-radius: .05rem;
            background-color: #2AD2C8;
            color: white;
            width: 200px;
        }
        .layer_dialog_box .layer_dialog_cn {
            /*height: 1.6rem;*/
            padding: 0rem .38rem;
            text-align: center;
        }
        #lastConfirm .layer_dialog_cn {
            line-height: .3rem;
            height: .6rem;
            text-align: center;
            color: #5f5f5f;
            font-size: .14rem;
            font-family: PingFang-SC-Medium;
        }


        #lastConfirm .layer_dialog_cn a{
            font-size: .12rem;
            color: #5f5f5f;
        }
        .layer_dialog_box .layer_dialog_title {
            font-weight: 700;
        }
        .layer_dialog_box .layer_dialog_cn .lanrenTitle {
            height: .16rem;
            width: 100%;
            text-align: left;
        }
        .layer_dialog_cn .lanrenTitle span {
            display: block;
            float: right;
            height: .3rem;
            line-height: .3rem;
            width: .6rem;
            text-align: right;
        }
        .lanrenTitleValue {
            height: .3rem;
            line-height: .3rem;
            width: 100%;
            text-align: left; 
            margin-top: .4rem;
        }
        .lanrenTitleValue a {
            display: block;
            float: left;
            width: 1rem;
            text-align: left;
        }
        .lanrenTitleValue span {
            display: block;
            float: right;
            width: 1rem;
            text-align: right;
        }
        .lanrenContent {
            height: .7rem;
            text-align: left;
            padding: .1rem 0;
        }
        .cell_cn span {
            display: block;
            float: right;
            width: .44rem;
            height: .28rem;
            line-height: .3rem;
            font-size: .14rem;
            color: white;
            text-align: center;
            border-radius: .05rem;
            background-color:rgb(229,192,149);
        }
        .tip a {
            color: #3276fe;;
        }


        .layer_dialog_box {
            padding: .1rem 0;
        }
        .layer_btn {
            display: block;
            position: relative;
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            -ms-flex: 1;
            flex: 1;
            text-align: center;
            letter-spacing: 1px;
            color: #353535;
            width: 1rem;
            border-radius: .1rem;
            background-color: #eee;
            /*margin: 0rem .2rem;*/

        }

            .layer_btn.layer_btn_primary {
                width: 2.25rem;
                height: .45rem;
                line-height: .45rem;
                font-size: .15rem;
                color: white;
                border-radius: .41rem;
                background-color: #ffb624;
            }

            .layer_btn + .layer_btn:after {
                content: " ";
                position: absolute;
                left: 0;
                top: 0;
                width: 1px;
                height: 100%;
                /*border-left: 1px solid #E4E4E4;*/
                color: #E4E4E4;
                -webkit-transform-origin: 0 0;
                transform-origin: 0 0;
                -webkit-transform: scaleX(.5);
                transform: scaleX(.5);
            }
        .layer_dialog .layer_dialog_ft {
            position: relative;
            line-height: .42rem;
            font-size: .17rem;
            display: -webkit-box;
            display: -webkit-flex;
            display: -ms-flexbox;
            display: flex;
            background-color: white;
        }

            .layer_dialog .layer_dialog_ft::after {
                content: " ";
                position: absolute;
                left: 0;
                top: 0;
                width: 100%;
                height: 1px;
                border-top: solid 0 white;
                color: #E4E4E4;
                -webkit-transform-origin: 0 0;
                transform-origin: 0 0;
                -webkit-transform: scaleY(.5);
                transform: scaleY(.5);
            }
        .layer_dialog_title {
            font-weight: 700;
        }

        .cells_content {
            display: none;
        }
        .disOn {
            display: block;
        }
        #bar>div {
            left: -.05rem;
        }
        .layer_dialog .layer_dialog_hd:after {
            border-top: 0px solid #E4E4E4
        }

        .getMoneyWay {
            font-size: .16rem;
            margin-top: .02rem;
        }
        .getMoneyWay a {
            font-size: .16rem;
        }
        .downLoadBar {
            height: .5rem;
            width: 100%;
            position: relative;
            overflow: hidden;
        }
        .downLoadBar img {
            width: 110%;
            position: absolute;
            top: 0;
            left: -5%;
        }
        .downloadbar {
            width: 3rem;
            margin: 0 auto;
            overflow: hidden;
        }
        .downloadbar a {
            display: block;
            width: 1.2rem;
            line-height: .4rem;
            margin: .2rem 0;
            color: white;
            border-radius: .05rem;
        }
        .downloadbar a img {
            display: block;
            padding: .1rem;
            height: .2rem;
            width: .2rem;
            float: left;
        }
        #appleDownload {
            background-color: green;
            float: left;
        }
        #androdDownload {
            background-color: rgb(253,138,80);
            float: right;
        }
        .tipsLog{
            display: block;
            width: 1.07rem;
            height: 1.07rem;
            margin: 0 auto;
        }
        .tabName{
            display: block;
            width: 100%;
            text-align: center;
            font-size: .12rem;
            
        }
        .tabName1{
            color: #3276FE;
        }
        .tabName2{
            color: #B9BEC8;
        }
        .load_btnCon{
            width: 90%;
            margin: .4rem auto 0;
        }
        .load_btn{
            display: inline-block;
            width: 1.1rem;
            height: .45rem;
            line-height: .45rem;
            text-align: center;
            color: #fff;
            border-radius: .4rem;
            margin: 0 .1rem;
        }
        .load_btnLog{
            display: inline-block;
            width: 100%;
            background: url(./img/ios.png) no-repeat -.05rem .15rem;
            background-size: 25%;
        }
        .load_btnLogAndrio{
            background: url(./img/andrio.png) no-repeat -.05rem .15rem;
            background-size: 25%;
        }        
        .load_btn1{
            background:  #3276FE;    
        }
        .load_btn2{
            background: #2EC562;    
        }
        .closeIco{
            width: .35rem;
            height: .35rem;
            line-height: .35rem;
            font-size: .34rem;
            color: #ffffff;
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%,320%);
            background: #696969;
            text-align: center;
            border-radius: 50%;
            z-index: 10;
        }
        header{
            width: 100%;
            height: .44rem;
            line-height: .44rem;
            position: fixed;
            left: 0;
            top: 0;
            background: #3276fe;
            border-bottom: .005rem solid #1656D6;
        }
        header img,
        header span,
        header a{
             display: inline-block;
             float: left;
        }
        header .backIcon{
            width: .24rem;
            height: .24rem;
            margin: .1rem 0 0 .16rem;
            /* opacity: 0; */
        }
        header img{
            width: .24rem!important;
        }
        header .pageTitle{
            width: 80%;
            text-align: center;
            color: #fff;
            font-size: .17rem;
        }
        header .refresh{
        	
            float: right;
            margin-right: .16rem;
            font-size: .14rem;
            color: #fff;
        }     
        .infoList{
        	display: flex;
        	justify-content:  space-around;
        	flex-wrap: wrap ;
	        padding: 0 .13rem .2rem;
        }  
        .infoList li{
        	width: 33%;
	        color: #fff;
    		margin-top: .2rem;
        }   
        .samllY{
	    	padding-left: .03rem;
		    font-size: .12rem;
		    color: rgba(255, 255, 255, .8);
        }
    </style>
</head>
<body>
    <!-- 蒙版 -->
    <div class="layer_load">
        <div class="layer_mask"></div>
        <div class="layer_load_icon icon-loading"></div>
    </div>
    <!-- <div class="downLoadBar"><img src="./images/downLoad.png" alt=""></div>  -->
    <!--<header>
            <a class="backIcon" href="#"></a>
            <span class="pageTitle">悟空招财</span>
            <span class="refresh"></span>
    </header> -->
    <div class="cardBanner"> 
	    <div class="cells">
	        <div class="cardBannerWrap">
	            <span class="titleContentLeft"><sup>￥</sup><span class="samllText"></span>元</span>
	            <div class="titleLeft">借款金额</div>
	        </div>
	        <div class="cardBannerWrap">
	            <span class="titleContentRight"><span class="samllText"></span>天</span>        
	            <div class="titleRight">借款期限</div>
	        </div>
	        <div class="clear"></div>
	        <ul class="infoList">
	        	<li>
		            <div class="cell_cn cell_cn1"></div>
		            <label class="cell_hd">利息</label>
	        	</li>
	        	<!--<li>
		            <div class="cell_cn cell_cn1"></div>
		            <label class="cell_hd">综合费率</label>
	        	</li>-->
	        	<li>
		            <div class="cell_cn cell_cn1"></div>
		            <label class="cell_hd">到期应还</label>
	        	</li>   
	        	<li>
		            <div class="cell_cn cell_cn1" id="cashValue"></div>
		            <label class="cell_hd" >到账金额</label>
	        	</li> 
	        	<li>
		            <div class="cell_cn cell_cn1" id="gameCode"></div>
		            <label class="cell_hd">会员费</label>
	        	</li>      
	        	<li>
		            <div class="cell_cn cell_cn1"></div>
		            <label class="cell_hd"></label>
	        	</li>  
	        	<li>
		            <div class="cell_cn cell_cn1"></div>
		            <label class="cell_hd"></label>
	        	</li> 
	        </ul>
	    </div> 
    </div>  
    <div class="cardBannerAfter"></div>
    <div class="operatorContent">
        <div class="tip">
            <i><img src="./img/selected.png" alt=""></i><span>我已阅读并同意<a href="./help/loanprotocol.html">《借款协议》</a></span>
        </div>
        <div class="submitBtn confirmBtn">开始申请</div>
    </div>
    <div class='layer_dialog' id="loadConfirm">
            <div class='layer_mask'></div>
            <div class='layer_dialog_box'>
                <img class="tipsLog" src="img/tipLog.png" />
                <div class='layer_dialog_hd'>
                    <span class='layer_dialog_title'>提示</span>
                    <i class='layer_btn_close icon-close' style='display:none'></i>
                </div>
                <div class='layer_dialog_cn'>
                      <a>您的借款次数已达到提额标准</a>
                           <a> 为您推荐悟空钱包</a>
                </div>
                <div class='load_btnCon'>
                    <a class='load_btn load_btn1' href="itms-services://?action=download-manifest&url=https://image.pushunjinfuchina.com/ioswu/manifest.plist"><span class="load_btnLog">苹果下载</span></a>
                    <a class='load_btn load_btn2' href="http://h5.pushunjinfuchina.com/Wukong-v1.0.0.apk"><span class="load_btnLog load_btnLogAndrio">安卓下载</span></a>
                </div>
            </div>
            <div class="closeIco">×</div>
    </div>    

    <div class="tab_bar">    
        <footer>
            <a href="#">
                <img src="./img/wallet.png">
                <span class="tabName tabName1">申请</span>
            </a>
            <a href="./user/myWallet.html">
                <img src="./img/my.png">
                <span class="tabName tabName2">个人中心</span>
            </a>
        </footer>   
    </div>
    <!-- 脚本 -->
    <script src="./lib/zepto.min.js?rev=@@hash"></script>
    <script src="./js/main.js?rev=@@hash"></script>
    <script>
        if(userUtil.sid() && userUtil.userID()){    //登录状态userUtil.sid() && userUtil.userID()
            (function(global,userUtil,layer){       
            var localH=localStorage.getItem("localH")
            if(!localH){
                localH=localStorage.setItem("localH",document.documentElement.clientHeight)
            }
            // $("body").height(Number(localH));
                var cashRate,
                borrowValue,
                maxCashRate,
                sessionId=userUtil.sid(),
                productId,
                gameRechargeRate;

                $(".tip i").click(function(){
                    if($(".tip i img").attr('src')=="./img/selected.png"){
                        $(".tip i img").attr('src',"./img/bingobefor.png");
                        $(".confirmBtn").css({"background-color":"#3276fe","opacity":".6"});
                        $(".confirmBtn").off("click");
                    }else {
                        $(".tip i img").attr('src',"./img/selected.png");
                        $(".confirmBtn").css({"background-color":"#3276fe","opacity":"1"});

                    }
                })
                $(".confirmBtn").css({"background-color":"#3276fe"});

                function cardAlert(obj) {
                    var conf = {
                        title: "提 示",
                        content: "",
                        btnText: "确 定",
                        btnEvent: function () { }
                    };
                    if (typeof obj == "string") { obj = { content: obj } };
                    $.extend(conf, obj);
                    $(".alert").addClass("on");
                    $(".alert .layer_dialog_title").text(conf.title);
                    // $(".alert .layer_dialog_cn").html(conf.content);
                    $(".alert .layer_btn").text(conf.btnText).off("click").on("click", function () { conf.btnEvent(); close(); });
                    $(".alert .layer_btn_close").off("click").on("click", function () { conf.btnEvent(); close(); });

                    function close() {
                        $(".alert").removeClass("on");
                    }
                };

                // 修改收款比例
                $(".cell_cn span ").click(function(){
                    var obj = {
                        title: "请选择充值比例",
                        content: "",
                        btnText: "我知道了",
                        btnEvent: function () {

                        }
                    };
                    cardAlert(obj);

                })

                //获取极速卡信息
                $.ajax({
                    url: global.localUrl + "wallet/system/initProduct",
                    type: "post",
                    data: JSON.stringify({"sessionId": sessionId,"userUuid" : localStorage.getItem("userID")}),
                    contentType: 'application/json;charset=utf-8',
                    success: function (re) {
                        if (1 == re.code) {
                            var _data=re.data[0];
                            gameRechargeRate=_data.gameRechargeRateMin;
                            maxCashRate=1-_data.gameRechargeRateMin;
                            cashRate=1-_data.gameRechargeRateMin;
                            borrowValue=_data.borrowingAmount;
                            productId=_data.productId;

                            //滑动条进度设置
                            $("#btn").css({"left":cashRate*170});
                            $("#bar>div").width(cashRate*170+20);
                            console.log(Math.ceil(cashRate*borrowValue));
                            $(".lanrenTitleValue a").text(Math.ceil(cashRate*borrowValue)+"元");
                            $(".lanrenTitleValue span").text((borrowValue-Math.ceil(cashRate*borrowValue))+"个");

                            $(".titleContentLeft .samllText").text(_data.borrowingAmount);
                            $(".titleContentRight .samllText").text(_data.borrowingTerm);
                            $(".cell_cn").eq(0).html(_data.interest+"<a class='samllY'>元</a>");
                            //$(".cell_cn").eq(1).text(_data.comprehensiveRate);//////显示费率
                            $(".cell_cn").eq(1).html(_data.repaymentAmount+"<a class='samllY'>元</a>");////应还金额
                            $("#cashValue").html((1-_data.gameRechargeRateMin)*_data.borrowingAmount+".00<a class='samllY'>元</a>");
                            $("#gameCode").html(_data.gameRechargeRateMin*_data.borrowingAmount+".00<a class='samllY'>元</a>");
                        }else{
                            layer.tips(re.message);
                        }
                    },
                    error: function () {
                        layer.tips(global.netError);
                    }
                });

                //confirm确认
                
                
                // $(".confirm .layer_btn").eq(0).off("click").on("click", function () {  close(); });
                $(".confirmBtn").off("click").on("click", function () {
                    if(!gameRechargeRate){
                        gameRechargeRate=0.2;
                    }
                    $.ajax({
                        url: global.localUrl + "wallet/orders/init",
                        type: "post",
                        data: JSON.stringify({
                            "sessionId": sessionId,
                            "productId": productId,
                            "gameRechargeRate": gameRechargeRate,
                            "userUuid" : localStorage.getItem("userID")
                        }),
                        contentType: 'application/json;charset=utf-8',
                        success: function (re) {
                            if (1 == re.code) {
                                localStorage.setItem("orderNo",re.data.orderNo);
                                if(re.data.flag == 1){
                                    $('#loadConfirm').css("display","block");
                                }else{
                                	window.location.href="trust/identification.html";
//                                  setTimeout(function(){
//                                  	
//                                      //window.location.href=global.localUrl +"trust/bindCard.html";
//                                      
//                                  },2000);
                                }
                            }else{
                                layer.tips(re.message);
                                setTimeout(function(){
                                    //window.location.reload();
                                },2000);
                            }
                        },
                        error: function () {
                            layer.tips(global.netError);
                        }
                    });
                    close(); 
                });

                $(".confirm .layer_btn_close").off("click").on("click", function () {  close(); });
                $("#loadConfirm .closeIco").on("click", function () {  
                    $("#loadConfirm").css("display","none");; 
                });
                function close() {
                    $(".confirm").removeClass("on");
                }
                /**
                 * 浏览器判断*/
                var browserObj = function () {
                    var u = navigator.userAgent;
                    return {
                        trident: u.indexOf('Trident') > -1, //IE内核
                        presto: u.indexOf('Presto') > -1, //opera内核
                        webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                        gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,//火狐内核
                        mobile: u.indexOf('Mobile') > -1, //是否为移动终端
                        ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                        android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端
                        iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
                        iPad: u.indexOf('iPad') > -1, //是否iPad
                        webApp: u.indexOf('Safari') == -1, //是否web应该程序，没有头部与底部
                        weixin: u.indexOf('MicroMessenger') > -1, //是否微信
                        qq: u.indexOf("QQBrowser") > -1, //是否QQ浏览器
                        mobile_qq: u.indexOf("MQQBrowser") > -1, //是否是手机QQ浏览器
                        uc: u.indexOf("UCBrowser") > -1, //是否是uc浏览器
                        baidu: u.indexOf("Baidu") > -1, //是否是百度浏览器
                        firefox: u.indexOf("Firefox") > -1, //是否是火狐浏览器
                        lieBao: u.indexOf("LieBao") > -1, //是否是猎豹浏览器
                        sogou: u.indexOf("SogouMobile") > -1, //是否是搜狗手机浏览器
                        wkqb:u.indexOf("wkqb") > -1

                    };
                };
                var browser = browserObj();
                //APP内隐藏
                if(browser.wkqb){
                    $(".downLoadBar").css({"display":"none"})
                }
                // $(".downLoadBar").click(function(){
                //     window.location.href=global.localUrl+"downLoad.html"
                // })
            })(global,userUtil,layer)

        }else{
            window.location.href="./user/login.html";
        }
    </script>
</body>
</html>